//2009/08/16 18:53:20
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
#include <sstream>
#include <algorithm>

using namespace std;

class ColorCode
{
public:
    long long getOhms(vector <string> code)
    {
        v["black"] = 0;
        v["brown"] = 1;
        v["red"] = 2;
        v["orange"] = 3;
        v["yellow"] = 4;
        v["green"] = 5;
        v["blue"] = 6;
        v["violet"] = 7;
        v["grey"] = 8;
        v["white"] = 9;
		long long cost = 0;
		for(int i=0; i<code.size()-1; i++)
		{
			cost = cost * 10 + v[code[i]];
			cout << cost << endl;
		}
		cost *= (long long)(pow10(v[code[code.size()-1]]));
		
		
        return cost;
    }
private:
    map<string, int> v;
};
